package com.controller.yxy;
import com.bean.yxy.Yxy1;
import com.service.yxyService.GetDataService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * 收费管理-1收费项目
 */
@Controller
@RequestMapping("/YXYpage/")
public class ChargesController {
    @Resource
    private GetDataService  getDataService;

    /**1
     * 获取小区列表
     * @return
     */
    @RequestMapping(value = "getListxiaoqu",method = RequestMethod.GET)
    @ResponseBody
    public  Object getListxiaoqu(HttpServletRequest req){
        return getDataService.getListxiaoqu();
    }

    /**1
     * 获取收费项目明细数据
     * @return
     */
    @RequestMapping(value = "getListshoufeixiangmu",method = RequestMethod.GET)
    @ResponseBody
    public  Object getListshoufeixiangmu(Integer newPage){
        return getDataService.getListshoufeixiangmu(newPage);
    }

    /**1
     * 删除操作单个
     * @return
     */
    @RequestMapping(value = "delectjilu",method = RequestMethod.POST)
    @ResponseBody
    public  Object delectjilu(String sid){
        return getDataService.delectjilu(sid);
    }

    /**1
     * 删除操作多个
     * @return
     */
    @RequestMapping(value = "delectjilus",method = RequestMethod.POST)
    @ResponseBody
    public  Object delectjilus(HttpServletRequest request){
      Object[] obj =   request.getParameterValues("sids[]");
      return getDataService.delectjilus(obj);
    }


    /**1
     *
     * 查询符合条件的获取数据
     * @param
     * @return
     */
    @RequestMapping(value = "selectmags",method = RequestMethod.GET)
    @ResponseBody
    public  Object selectmags(Integer id,String xqid,String name){
        return getDataService.selectmags(id,xqid,name);
    }

    /**1
     * 添加一条数据
     * @param y
     * @return
     */
    @RequestMapping(value = "addmages",method = RequestMethod.GET)
    @ResponseBody
    public Object addmages(Yxy1 y){
        return getDataService.add(y);
    }
}
